<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>

        // 自定义对象
        function People(name, age) {
            this.name = name
            this.age = age;
            this.introduce = function () {
                console.log("我叫" + this.name + "，年龄" + this.age);
            }
        }
        
    //自定义狗的构造函数,创建对象
    function Dog(name,age,sex) {
      this.name=name;
      this.age=age;
      this.sex=sex;
    }



    var people = new People("wx",22);
    people.introduce();
    var dog=new Dog("大黄",20,"男");
    console.log(dog instanceof People);//false
    console.log(dog instanceof Dog);
    console.log(people instanceof People);
    </script>
</body>

</html>